﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

/// <summary>
///AdverDao 的摘要说明
/// </summary>
public class AdverDao
{
    DBMM dbm = new DBMM();
    DataTable dt = null;
    string sql = null;
    AdverVo av = new AdverVo();

    //获得所有广告图文信息
    public DataTable getAdver()
    {
        sql = "select * from Adver";
        dt = new DataTable();
        dt = dbm.GetTable(sql);
        return dt;
    }

    //修改广告图文信息
    public Exception updateAdver(AdverVo av)
    {
        sql = "update Adver set Aurl=@Aurl,Alink=@Alink where Aid=@Aid";
        SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@Aurl", av.Aurl),
                                                 new SqlParameter("@Alink", av.Alink),
                                                 new SqlParameter("@Aid", av.Aid)};
        Exception ex = null;
        ex = dbm.Execute(sql, sp);
        return ex;
    }
}
